<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TDeviceparam extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_deviceparam', function (Blueprint $table) {
             $table->engine = 'MyISAM';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->bigInteger('Dp_index')->nullable(false)->comment('');
			$table->bigInteger('Dp_id')->nullable(false)->default(0)->comment('');
			$table->integer('dt_typeid')->nullable(false)->default(0)->comment('');
			$table->integer('dp_cmdup')->nullable(false)->default(0)->comment('');
			$table->integer('dp_cmddown')->nullable(false)->default(0)->comment('');
			$table->string('dp_paramname', 64)->nullable(false)->default('')->comment('');
			$table->string('dp_paramdesc', 64)->nullable(false)->default('')->comment('');
			$table->integer('dp_type')->nullable(false)->default(0)->comment('');
			$table->integer('dp_datatype')->nullable(false)->default(0)->comment('');
			$table->double('dp_adjustk', 15, 3)->nullable(false)->default(0)->comment('');
			$table->double('dp_adjustb', 15, 3)->nullable(false)->default(0)->comment('');
			$table->string('dp_unit', 8)->nullable(false)->default('')->comment('');
			$table->string('dp_memo', 255)->nullable()->default(null)->comment('');
			$table->string('dp_func_typeid', 100)->nullable(false)->default(0)->comment('');
			$table->string('dp_warnid', 10)->nullable()->default(null)->comment('');
			$table->primary('Dp_index');
			$table->unique('Dp_index', 'Dp_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_deviceparam');
    }
}
